package com.lambda.demo01;

public class Test {
    /*
    lambda 表达式()->{}
    lambda 表达式的前提   接口  类或抽象类都不行
            接口中有且只能有一个抽象方法
     */
    public static void main(String[] args) {
        useSwimming(new Swimming() {
            @Override
            public void swim() {

            }
        });
        useFu(new Fu(){
            @Override
            public void sing() {
                System.out.println("大碗宽面");
            }
        });
    }
    public static void useSwimming(Swimming swim){
        swim.swim();
    }
    public static void useFu(Fu fu){
        fu.sing();
    }
}
interface  Swimming{
    void swim();
   default  void dance(){

   }
}
class Fu{
    public void sing(){
        System.out.println("只因你太美");
    }
}